home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Just Call Me Internet
/
Just Call Me Internet.iso
/
prog
/
atari
/
m2
/
cat3src
/
cat
/
memory.i
< prev
next >
Wrap
Text File
|
1997-10-26
|
2KB
|
82 lines
IMPLEMENTATION MODULE Memory;
FROM SYSTEM IMPORT ADDRESS, ASSEMBLER;
(*$L-,R-,S-,M-*)
PROCEDURE MoveBlock(Source, Dest : ADDRESS; Count : LONGCARD);
BEGIN
ASSEMBLER
MOVE.L -(A3),D0 ;Anzahl
MOVEA.L -(A3),A1 ;Source
MOVEA.L -(A3),A0 ;Dest
TST.L D0
BEQ.S endMove
CMPI.L #$FFFF,D0
BCC.S bigOne
CMPA.L A1,A0
BEQ.S endMove
BHI.S normal
;---------------------------------------------------------
viceVersa:
ADDA.L D0,A0 ;jetzt am Ende anfangen
ADDA.L D0,A1 ;wg. berschneiden
SUBQ.L #1,D0 ;wg. dingens
Loop1:
MOVE.B -(A0),-(A1)
DBF D0,Loop1
BRA.S endMove
;---------------------------------------------------------
normal:
SUBQ.L #1,D0
Loop2:
MOVE.B (A0)+,(A1)+
DBF D0,Loop2
BRA.S endMove
;=========================================================
bigOne:
; MOVEA.L -(A3),A1 ;Source
; MOVEA.L -(A3),A0 ;Dest
CMPA.L A1,A0
BEQ.S endMove
BHI.S normal2 ;a0 > a1 - Source > Dest
;--------------------------------------------------------
viceVersa2:
ADDA.L D0,A0 ;jetzt am Ende anfangen
ADDA.L D0,A1 ;wg. berschneiden
Loop21:
MOVE.B -(A0),-(A1)
SUBQ.L #1,D0
BNE.S Loop21
BRA.S endMove
;--------------------------------------------------------
normal2:
Loop22:
MOVE.B (A0)+,(A1)+
SUBQ.L #1,D0
BNE.S Loop22
endMove:
END;
END MoveBlock;
END Memory.